class CreateAcademicSpaceServices < ActiveRecord::Migration
  def self.up
    create_table :academic_space_services do |t|
      t.references :academic_space
      t.references :service

      t.timestamps
    end
    add_index(:academic_space_services, [:academic_space_id, :service_id], :unique => true, :name => "academic_space_services_asid_sid")
    add_index(:academic_space_services, :academic_space_id, :unique => false)
  end

  def self.down
    remove_index(:academic_space_services, :name => "academic_space_services_asid_sid")
    remove_index(:academic_space_services, :column => :academic_space_id)
    drop_table :academic_space_services
  end
end
